home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 13 / CU Amiga Magazine's Super CD-ROM 13 (1997)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1997-08].iso / CUCD / Programming / MCC_HTMLtext / Rexx / preview.ged
Text File  |  1997-04-02  |  1KB  |  71 lines

  1. /* $VER: 1.0, ©1996 Dietmar Eilert. HTML preview for moreHTML 1.x
  2. ** Modified 1997 by Dirk Holtwick
  3. ** -------------------------------------------------------------------
  4. ** If you want to use moreHTML instead of an other Browser for
  5. ** a preview from GoldEd, just copy this script to
  6. ** golded:tools/www/arexx/preview.ged
  7. */
  8.  
  9. OPTIONS RESULTS                             /* enable return codes     */
  10.  
  11. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  12.     address 'GOLDED.1'
  13.  
  14. 'LOCK CURRENT RELEASE=4'                    /* lock GUI, gain access   */
  15.  
  16. if (RC ~= 0) then
  17.     exit
  18.  
  19. OPTIONS FAILAT 6                            /* ignore warnings         */
  20.  
  21. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  22.  
  23. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  24.  
  25. if (show('P', "MOREHTML.1") = 0) then
  26.  
  27.     'REQUEST PROBLEM="moreHTML ARexx port not found"'
  28.  
  29. else do
  30.  
  31.     'QUERY DOC VAR=DOC'
  32.  
  33.     if (exists(DOC)) then
  34.  
  35.         'SAVE ALL'
  36.  
  37.     else do
  38.  
  39.         DOC = "t:preview.html"
  40.  
  41.         'SAVE ALL EXPORT NAME="' || DOC || '"'
  42.     end
  43.  
  44.     'UNLOCK'
  45.  
  46.     ADDRESS 'MOREHTML.1'
  47.  
  48.     'GOTOURL "file://localhost/' || DOC || '"'
  49.  
  50.     ADDRESS 'MOREHTML.1'
  51.  
  52.     'SHOW'
  53.  
  54.     exit
  55. end
  56.  
  57. /* ---------------------------- END OF YOUR CODE --------------------- */
  58.  
  59. 'UNLOCK' /* VERY important: unlock GUI */
  60.  
  61. exit
  62.  
  63. SYNTAX:
  64.  
  65. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  66.  
  67. 'UNLOCK'
  68.  
  69. exit
  70.  
  71.